package com.hnevc.saveqq;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends AppCompatActivity {
    EditText mEtUserName;
    EditText mEtPassword;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        initView();
    }

    private void initView() {
        mEtPassword = findViewById(R.id.et_password);
        mEtUserName = findViewById(R.id.et_user_name);
    }

    public void login(View view) {
        String userName = mEtUserName.getText().toString();
        String password = mEtPassword.getText().toString();
        if(userName.equals("admin") && password.equals("123")){
            Toast.makeText(this, "用户名密码正确", Toast.LENGTH_SHORT).show();
        }else{
            Toast.makeText(this, "用户名密码错误！", Toast.LENGTH_SHORT).show();
        }
    }
}
